package com.mianyang.zhangsan.common.util;

import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Method;

/**
 * 反射执行工具类
 * @author jiangjr
 * @date 2022-10-25
 */
@Slf4j
public class ExecuteUtils {

    public static Object invoke(Object var1, String var2, Class<?>[] var3, Object ...var4) {
        Object var5 = null;
        try {
            Method method = var1.getClass().getMethod(var2, var3);
            var5 = method.invoke(var1, var4);
        } catch (Exception e) {
            log.error("反射执行方法异常");
            throw new RuntimeException("反射执行方法异常");
        }
        return var5;
    }
}
